#{extends 'mainFMPA.html' /}
#{set title:'Ajouter une FMPA SAP quinquennale'/}
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js"></script>

<SCRIPT>
	$(function() {
		$( "#date" ).datepicker();
	});
</SCRIPT>
 
 <style type="text/css">
 	.hidden {
 		display: none;
	}
	.visible {
 		display: inline;
	}
</style>
<SCRIPT LANGUAGE="JavaScript">
	$(document).ready(function() {
		var Today = new Date;
		var Annee = Today.getFullYear();
		document.getElementById('annee').value=Annee;
		$('#aModifier').load("/sequences/"+Annee)
	} );
</SCRIPT>

<h3>Ajouter une FMPA SAP quinquennale</h3>
     
#{form @newQuinquenalSave()}
    <p>
 	    <label for="cis" id="cis">CIS* :</label>
        #{select 'cis', items:centres, id:'cis', valueProperty:'id', value:idCis,}
        #{/select}
    </p>
    <p>
        <label for="date">Date* :</label>
        <input type="text" name="date" id="date" value="${fmpaQ?.fmpa?.date?.format('dd/MM/yyyy', 'fr')}" />
    </p>
    <p>
        <label for="annee">Ann&eacute;e de prise en compte* :</label>
        <input type="text" name="annee" id="annee" onChange="change()"/>
    </p>
    <p>
 	    <label for="description">Description :</label>
    	<textarea name="description" id="description" >${fmpaQ?.fmpa?.description}</textarea>
        
    </p>
    <p>
 	    <label for="duree">Dur&eacute;e* :</label>
        #{select 'duree', items:durees, id:'duree', value:fmpaQ?.fmpa?.duree?.id}
            #{option 0}-- Choisir une valeur --#{/option}
        #{/select}
    </p>
    <p id="aModifier">
    </p>
    <p>
       	<label for="observation">Observation :</label>
    	<textarea name="observation" id="observation" >${fmpaQ?.fmpa?.observation}</textarea>
    </p>
    <p>
    <br />
	<input type="hidden" name="thematique" value=${thematique.id} >
    <p style="margin-top:30px; margin-left:170px;">    
        <input type="submit" value="Enregistrer la FMPA" />
        <input type="button" onClick="self.location.href='@{FMPAQuinquennals.listFMPA(Annee)}'" value="retour" />
    </p>
    <p style="font-size:16px;"><i>* Champs obligatoires<i></p>
#{/form}

<SCRIPT type="text/javascript">
	function change(){
	    var monAnnee=document.getElementById("annee").value
	    $('#aModifier').load("/sequences/"+monAnnee)
	}
</SCRIPT>